package com.liss.boot.ditest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/human")
public class HumanController {
//    @Inject
//    @Resource(name = "teacherServiceImpl") //方法三
//    @Resource(type = DoctorServiceImpl.class) //方法二
//    @Autowired
//    @Qualifier("teacherServiceImpl")//方法一
    private HumanService humanService;

    @RequestMapping("/name")
    public String name(){
        return humanService.name();
    }
    /**
     * 1、基于filed注入
     * @Autowired
     * private Svc svc;
     * 2、基于 setter 方法注入
     * private Helper helper;
     * @Autowired
     * public void setHelper(Helper helper) {    this.helper = helper;}
     * 3、构造器注入
     * private final Svc svc;
     *
     * @Autowired
     * public HelpService(@Qualifier("svcB") Svc svc) {
     *     this.svc = svc;
     * }
     */
} 